#pragma once

#include "../QRSWidgetBase.h"
#include "ui_RoundOffOperationWidget.h"

#include "Render/QIVtkSelectionPipeline.h"
#include <TopoDS_Edge.hxx>

QT_BEGIN_NAMESPACE
namespace Ui { class RoundOffOperationWidgetClass; };
QT_END_NAMESPACE

class MainWindow;
class ShapeOperation;

class RoundOffOperationWidget : public QRSWidgetBase
{
	Q_OBJECT

public:
	RoundOffOperationWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	~RoundOffOperationWidget();
protected:
	void closeEvent(QCloseEvent* event) override;
	void OnSelectedSubShapes(QIVtkSelectionPipeline* actor);
	void OnModify();
	void OnConfirm();
private:
	Ui::RoundOffOperationWidgetClass *ui;
protected:
	std::vector<std::reference_wrapper<const TopoDS_Shape>> m_shapelist;
	Handle(QIVtkSelectionPipeline) m_selectedActor;
	Handle(QIVtkSelectionPipeline) cacheActor;
	float _radius = 0;
	std::vector<TopoDS_Edge> edgesToRoundCache;
};
